package syscall

import (
	"unsafe"
	"sync"
)

var (
	lock sync.Mutex
	objects map[unsafe.Pointer]int
)

func init() {
	objects = make(map[unsafe.Pointer]int)
}

func LockObject(ptr unsafe.Pointer) {
	lock.Lock()
	defer lock.Unlock()

	objects[ptr] = 1;
}

func UnlockObject(ptr unsafe.Pointer) {
	lock.Lock()
	defer lock.Unlock()

	delete(objects, ptr)
}
